package com.clusterswisdom.horn.api.tmall.action.refund;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.taobao.api.TaobaoResponse;

public class AgreeRefundsCodeAction extends ConfirmTRefundAction implements HornAction {
	
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param) throws Exception {
		TaobaoResponse response = agreeRefund(param, getRefund(param));
		if (response.isSuccess()) {
			return new HornResponse(true, null);
			
		} else {
			return getUnsuccessResponse(response);
			
		}
	}
}